
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By

s=Service(r"/Users/didi1/Desktop/chromedriver.exe")
wb=webdriver.Chrome(service=s)
wb.implicitly_wait(10)
# r:表示后面的路径不存在转译
wb.get('http://cdn1.python3.vip/files/selenium/test2.html')
# 获取当前选中的元素
element = wb.find_element(By.CSS_SELECTOR, '#s_radio input[checked=checked]')
print('当前选中的是: ' + element.get_attribute('value'))
# 点选 小雷老师
wb.find_element(By.CSS_SELECTOR, '#s_radio input[value="小雷老师"]').click()

